<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>追加审核zhuiWeiAduit.html</title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />
	<style>
		body{
			background:#f1f1f1;
			padding-bottom:20px;
		}
		.title{
			height:45px;
			line-height:45px;
			margin-left:4px;
			font-size:14px;
			font-weight:900;
			width:1032px;
		}
		.quare{
			margin:0 7px 0 11px;
			position:relative;
			top:3px;
			display:inline-block;
			width:4px;
			height:16px;
			background:#00aa98;
		}
		.adultQuare{
			width:4px;
			background:#00aa98;
		}
		.contentBox{
			width:1032px;
			background:white;
			margin-left:14px;
		}
		.times{
			line-height:40px;
			margin-left:20px;
		}
		.content{
			padding-bottom:20px;
			padding-top:20px;
		}
		.content table{
			width:990px;
			margin-left:20px;
		}
		.content table th,td{
			height:30px;
			border:1px solid #e7e7e7;
		}
		.content table th{
			background:#f1f1f1;
		}
		.backButton{
			text-align:center;
			padding:20px 0 ;
		}
		.peopleTotal{
			display:inline-block;
			margin-left:20px;
			font-weight:normal;
		}
		.peopleTotal span{
			color:red;
		}
		.head{
			line-height:45px;
	
		}
		.btnBox{
		
			text-align:center;
			margin-top:15px;
		}
		.cancel{
		background:#afb1b0;
		margin-left:10px;
		}
		table tbody input{
			font-family:"微软雅黑";
			width:100%;
			height:100%;
			border:none;
			text-align:center;
			outline:none;
		}
		.departureDate,.arriveAirportDate{
			text-align:left;
			margin-left:4px;
		}
	
	
		.audioMess{
			line-height:44px;
			margin-left:20px;
		}
		.audioMess span{
			position:relative;
			top:5px;
			margin-right:5px;
		}
		textarea{
			margin-left:10px;
			width:800px;
			height:100px;
			font-family:"微软雅黑";
			background:#fafafa;
			border:1px solid #e7e7e7;
		}
	    
	</style>
	<body ng-app="myApp" ng-controller="ctrl1">	
		<p class='title'>
			<span><i class='quare'></i>追加座位数</span>
		</p>
		<div class='contentBox'>
			<div class='content'>
				<table class="connectFlight">
					<tr>						
						<th>总人数</th> 
						<th>成人</th>
						<th>儿童</th>
						<th>婴儿</th>
						<th>舱位</th>
						<th>行程类型</th>
					</tr>
					<tbody class="clear">
						<tr>							
							<td class="">{{data.adultCount+data.childCount+data.infantCount}}</td>
							<td class="">{{data.adultCount}}</td>
							<td class="">{{data.childCount}}</td>
							<td class="">{{data.infantCount}}</td>
							<td class="">{{cabin}}</td>
							<td class="">{{data.roundType|roundType}}</td>
						</tr>						
					</tbody>
				</table>
			</div>
		</div>		
		<p class='title'>
			<span><i class='quare'></i>票价与支付</span>
			<span class='peopleTotal'>总费用 : <span id="audlt" class="totalPrice">{{(data.adultCount*((postData.adultPrice-0)+(postData.adultTax-0)))+(data.childCount*((postData.childPrice-0)+(postData.childTax-0)))+(data.infantCount*((postData.infantPrice-0)+(postData.infantTax-0)))|number:"2"}}</span>{{baojia}}</span>
		</p>
		<div class='contentBox'>
			<div class='content' style='padding-top:20px;'>
				<table>
					<tr>
						<th>旅客类型</th>
						<th>舱位</th>
						<th>票价</th>
						<th>税金</th>
						<th>总费用(单人)</th>
						<th>旅客人数</th>
						<th>总费用</th>						
					</tr>
					<tbody class="pjzf">
						<tr>
							<td>成人</td>
							<td>{{cabin}}</td>
							<td><input ng-model="postData.adultPrice" type="text" class=""></td>
							<td><input ng-model="postData.adultTax" type="text" class=""></td>
							<td class="">{{(postData.adultPrice-0)+(postData.adultTax-0)|number:"2"}}</td>
							<td class="">{{data.adultCount}}</td>
							<td class="">{{data.adultCount*((postData.adultPrice-0)+(postData.adultTax-0))|number:"2"}}</td>
						</tr>
						<tr>
							<td>儿童</td>
							<td>{{cabin}}</td>
							<td><input ng-model="postData.childPrice" type="text" class=""></td>
							<td><input ng-model="postData.childTax" type="text" class=""></td>
							<td class="">{{(postData.childPrice-0)+(postData.childTax-0)|number:"2"}}</td>
							<td class="">{{data.childCount}}</td>
							<td class="">{{data.childCount*((postData.childPrice-0)+(postData.childTax-0))|number:"2"}}</td>
						</tr>
						<tr>
							<td>婴儿</td>
							<td>{{cabin}}</td>
							<td><input ng-model="postData.infantPrice" type="text" class=""></td>
							<td><input ng-model="postData.infantTax" type="text" class=""></td>
							<td class="">{{(postData.infantPrice-0)+(postData.infantTax-0)|number:"2"}}</td>
							<td class="">{{data.infantCount}}</td>
							<td class="">{{data.infantCount*((postData.infantPrice-0)+(postData.infantTax-0))|number:"2"}}</td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
		 <!-- 合同审核信息 -->
		 <p style='padding:8px 0;' class='title'>
			<span><i class='quare'></i>合同审核信息</span>
		</p>
		<div class='contentBox' style="padding-top:20px; padding-bottom:20px;">
			<p class='audioMess'>审核结论 ：<span><input ng-model="postData.audit" value=true type='radio' name='choose'/></span>通过<span><input ng-model="postData.audit" style="margin-left:10px;" value=false type='radio' name='choose' /></span>不通过</p>
			<p style='margin-left:20px;display:inline-block;vertical-align:top'>审核意见 <span style="color:#aaaaaa;">(300字以内)</span></p>
			<textarea ng-model="postData.remark" class='reason'></textarea>		
		</div>
		 
		<div class='btnBox'>
			<button ng-click = "submit()" class='Dolo_btn sure'>确认</button>
			<button ng-click = "cancel()" class='Dolo_btn cancel'>取消</button>
		</div>  
	</body>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>
		<script type="text/javascript" src="../js/jquery.autocomplete.js" ></script>
		<script type="text/javascript" src="../js/angular.min.js" ></script>
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>
			<!-- 引入my97日期时间控件 -->
		<script type="text/javascript" src="../js/My97DatePicker/WdatePicker.js" charset="utf-8"></script>	
		<script type="text/javascript" src="../js/common.js" ></script>
		<script>
	
		var myApp = angular.module("myApp",[])
		myApp.controller("ctrl1",function($scope,$http){
			var index = getHref().index;
			var orderId = getHref().orderId;
			var osid = getHref().osid;
			var cabin = getHref().cabin;
			var baojia = commomFun.currencyMStr(parent.$(".baojiaCurrency").text());
			$scope.baojia = baojia;
			$scope.cabin = cabin;
			//渲染数据
			draw();
			function draw(){
				$http({
					url:"../order/"+orderId+"/seat/add/list?temp="+Math.random(),
					method:'post',
					data:{"status":null,"outside":"1"}		
				})
				.then(function(data){
					if(data.data.status==1001){
						$scope.data = data.data.data[index];						
						$scope.postData = {
								"adultPrice":data.data.data[index].adultPrice,
								"childPrice":data.data.data[index].childPrice,
								"infantPrice":data.data.data[index].infantPrice,
								"adultTax":data.data.data[index].adultTax,
								"childTax":data.data.data[index].childTax,
								"infantTax":data.data.data[index].infantTax,
								"audit":"true",
								"remark":""
						};						
					}
				});
			}
			//提交的数据
			
			//提交
			$scope.submit = function(){	
				layer.confirm('确定审核？', {
				  	btn: ['确定','取消'] //按钮
				}, function(){
				 	sure();	
				});									
			};
			
			function sure(){
				layer.load();
				$http({
					url:"../order/"+orderId+"/outside/seat/"+osid+"/audit?temp="+Math.random(),
					method:'post',
					data:$scope.postData	
				})
				.then(function(data){
					layer.closeAll('loading');
					if(data.data.status==1001){
						layer.msg('已审核', {icon: 1},function(){
							closeWin();
	                    });
					}else{
						layer.alert("审核失败 "+data.data.message);
					}
				});
			}
			
			$scope.cancel = function(){
				closeWin();
			};
		})		
		myApp.filter("roundType",function(){
			return function(input){
				if(input=="0"){
					return "往返";
				}else if(input=="1"){
					return "去程";
				}else if(input=="2"){
					return "回程";
				}else{
					return "";
				}
			}
		});
		
		
		
		</script>		
</html>
